package com.mlnx.netty.ecg;


import com.mlnx.netty.base.handler.EventHandle;
import com.mlnx.netty.base.handler.PushEcgHandle;
import com.mlnx.netty.base.handler.RegisterHandle;
import com.mlnx.netty.ecg.handler.MpDecode;
import com.mlnx.netty.ecg.handler.MpEncode;
import com.mlnx.netty.ecg.handler.MpServerHandle;
import com.mlnx.netty.ecg.handler.MpVerify;
import com.mlnx.netty.ecg.handler.PushHandle;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * Created by amanda.shan on 2019/10/9.
 */
public class EcgServerInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {

        ch.pipeline().addLast(new EventHandle());
        ch.pipeline().addLast(new MpDecode());
        ch.pipeline().addLast(new MpEncode());

        ch.pipeline().addLast(new MpVerify());
        ch.pipeline().addLast(new MpServerHandle());
        ch.pipeline().addLast(new PushHandle());
        ch.pipeline().addLast(new RegisterHandle());
        ch.pipeline().addLast(new PushEcgHandle());
    }
}
